home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / mallcrawl.swf / scripts / __Packages / PowerUpItems.as < prev    next >
Encoding:
Text File  |  2007-09-28  |  1.1 KB  |  45 lines

  1. class PowerUpItems extends MovieClip
  2. {
  3.    var available_to_hit;
  4.    var interval_id;
  5.    var POWER_ITEM_TIMER = 10;
  6.    function PowerUpItems()
  7.    {
  8.       super();
  9.       this.available_to_hit = true;
  10.    }
  11.    function onEnterFrame()
  12.    {
  13.       if(this.hitTest(_global.Rescuer) && this.available_to_hit && !_global.Rescuer.currentPowerItem)
  14.       {
  15.          _global.Rescuer.currentPowerItem = this._name;
  16.          _global.Rescuer[this._name].gotoAndPlay("go");
  17.          this.activate();
  18.       }
  19.    }
  20.    function activate()
  21.    {
  22.    }
  23.    function addToScore(count)
  24.    {
  25.       _global.Footer.addScore(count);
  26.    }
  27.    function stickToRescuer()
  28.    {
  29.       _global.Rescuer[this._name]._visible = true;
  30.    }
  31.    function killPowerUp()
  32.    {
  33.       this.killCustom();
  34.       _global.Rescuer[this._name].gotoAndStop("stop");
  35.       _global.Rescuer.currentPowerItem = undefined;
  36.       _global.Rescuer[this._name]._visible = false;
  37.       clearInterval(this.interval_id);
  38.       this.enabled = false;
  39.       this.removeMovieClip();
  40.    }
  41.    function killCustom()
  42.    {
  43.    }
  44. }
  45.